home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / APK.CMD < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.8 KB  |  114 lines

  1. #        APK - AKADEMIA PANA KLESKA LOGIN.CMD
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter your dial up phone number"]
  9.     save $number
  10.   end
  11. end
  12. if ![load $username]
  13.   if [username "Enter your login username"]
  14.     save $username
  15.   end
  16. end
  17. if ![load $password]
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21. end
  22. $modemsetup = "&c1&k3"
  23. $userprompt = "ogin:"
  24. $passprompt = "assword:"
  25. $pppcmd = "ppp"
  26.  
  27. %attempts = 10
  28. #
  29. #
  30. #----------------------------------------------------------
  31. #
  32. # initialize modem
  33. #
  34. output "atz"\13
  35. if ! [input 10 OK\n]
  36.   display "Modem is not responding"\n
  37.   abort
  38. end
  39. #
  40. # setup our modem commands
  41. #
  42. output "at"$modemsetup\13
  43. input 10 OK\n
  44. #
  45. # send phone number
  46. #
  47. %n = 0
  48. repeat
  49.   if %n = %attempts
  50.     display "Too many dial attempts"\n
  51.     abort
  52.   end
  53.   output "atdt"$number\13
  54.   %ok = [input 60 CONNECT]
  55.   %n = %n + 1
  56. until %ok
  57. input 10 \n
  58. #
  59. #  wait till it's safe to send because some modem's hang up
  60. #  if you transmit during the connection phase
  61. #
  62. wait 30 dcd
  63. #
  64. # now prod the terminal server
  65. #
  66. output \13
  67. #
  68. #  wait for the username prompt
  69. #
  70. input 30 $userprompt
  71. output $username\13
  72. #
  73. # and the password
  74. #
  75. input 30 $passprompt
  76. output $password\13
  77. #
  78. # we are now logged in
  79. #
  80. input 30 $prompt
  81. if %ppp
  82.   #
  83.   # jump into ppp mode
  84.   #
  85.   output $pppcmd\13
  86.   #
  87.   input 30 \n
  88.   #
  89.   display "PPP mode selected.  Will try to negotiate IP address."\n
  90.   #
  91. else
  92.   #
  93.   # jump into slip mode
  94.   #
  95.   output $slipcmd\13
  96.   #
  97.   # wait for the address string
  98.   #
  99.   input 30 $addrtarg
  100.   #
  101.   # parse address
  102.   #
  103.   address 30
  104.   input 30 \n
  105.   #
  106.   # we are now connected, logged in and in slip mode.
  107.   #
  108.   display \n
  109.   display Connected.  Your IP address is \i.\n
  110. end
  111. #
  112. # now we are finished.
  113. #
  114.